/**
 * 貌似是新浪投票的
 *
 +-------------------------------------------------
 * @link
 * @copyright
 * @author Haijun Wu <nicholasinlove@126.com>
 +------------------------------------------------- 
 * 
 * $Id: vote.js 61 2011-03-22 11:11:45Z nicholasinlove1986@gmail.com $
 */
 
var this$ = function() {
	
	var p={},pub={};

	p.drawPercentageBar=function(){		
		var w=0;
		$.each(p._bars,function(i,obj){
			obj=$(obj);
			w=obj.find(".precent-num > font").html();
			obj.find(".precent").animate({width:w,"opacity":.5},p._interval,function(){
				$(this).animate({"opacity":1},"fast");
			});						
		});
	};

    p.initVar = function(opts) { 
		p._interval=opts.interval||'slow';
		p._bars=$(".item");
	};

    p.onLoaded = function() { 
		p.drawPercentageBar();
	};

    p.initEvents = function(opts) {
        $(document).ready(p.onLoaded);
		
    };
	
    pub.Init = function(opts) {
        p.initVar(opts);
        p.initEvents(opts);
    };
	
    return pub;
	
} ();

